<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: PDM_PCM      (PDM-PCM Converter)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__pdm__pcm.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a>  </div>
  <div class="headertitle">
<div class="title">PDM_PCM (PDM-PCM Converter)</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<dl class="section note"><dt>Note</dt><dd>IP Supported: AUDIOSS </dd>
<dd>
Device Categories: CAT1A. Please refer <a href="usergroup1.html">Device Catalog</a>.</dd></dl>
<p>The pulse-density modulation to pulse-code modulation (PDM-PCM) driver provides an API to manage PDM-PCM conversion. A PDM-PCM converter is used to convert 1-bit digital audio streaming data to PCM data.</p>
<p>The functions and other declarations used in this driver are in cy_pdm_pcm.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.</p>
<p>Features:</p><ul>
<li>Supports FIFO buffer for Incoming Data</li>
<li>Supports Software Mute Mode</li>
<li>Programmable Gain Settings</li>
<li>Programmable Word Length</li>
</ul>
<p>Pulse-density modulation, or PDM, represents an analog signal with a binary signal. In a PDM signal, specific amplitude values are not encoded into codewords of pulses of different weight as they would be in pulse-code modulation (PCM); rather, the relative density of the pulses corresponds to the analog signal's amplitude. The output of a 1-bit DAC is the same as the PDM encoding of the signal.</p>
<p>Pulse-code modulation (PCM) is the method used to digitally represent sampled analog signals. It is the standard form of digital audio in computers, compact discs, digital telephony, and other digital audio applications. In a PCM stream, the amplitude of the analog signal is sampled regularly at uniform intervals, and each sample is quantized to the nearest value within a range of digital steps.</p>
<h1><a class="anchor" id="group_pdm_pcm_configuration_considerations"></a>
Configuration Considerations</h1>
<p>To set up a PDM-PCM, provide the configuration parameters in the <a class="el" href="structcy__stc__pdm__pcm__config__t.html">cy_stc_pdm_pcm_config_t</a> structure.</p>
<p>For example, set dataStreamingEnable to true, configure rxFifoTriggerLevel, dmaTriggerEnable (depending on whether DMA is going to be used), provide clock settings (clkDiv, mclkDiv and ckoDiv), set sincDecRate to the appropriate decimation rate, wordLen, and wordBitExtension. No other parameters are necessary for this example.</p>
<p>To initialize the PDM-PCM block, call the <a class="el" href="group__group__pdm__pcm__functions__v2.html#ga26938ec1c8eb9fe737fffabfa68f33b4">Cy_PDM_PCM_Init</a> function, providing the filled <a class="el" href="structcy__stc__pdm__pcm__config__t.html">cy_stc_pdm_pcm_config_t</a> structure.</p>
<p>If you use a DMA, the DMA channel should be previously configured. PDM-PCM interrupts (if applicable) can be enabled by calling <a class="el" href="group__group__pdm__pcm__functions.html#gaecd6316cef42b4c9d31b38aad0c222e6">Cy_PDM_PCM_SetInterruptMask</a>.</p>
<p>For example, if the trigger interrupt is used during operation, the ISR should call the <a class="el" href="group__group__pdm__pcm__functions.html#ga93d86ba7f06b583502f1300eafde9783">Cy_PDM_PCM_ReadFifo</a> as many times as required for your FIFO payload. Then call <a class="el" href="group__group__pdm__pcm__functions.html#ga9519b93d2271e63fc4fbce99cc555d5e">Cy_PDM_PCM_ClearInterrupt</a> with appropriate parameters.</p>
<p>If a DMA is used and the DMA channel is properly configured, no CPU activity (or application code) is needed for PDM-PCM operation.</p>
<h1><a class="anchor" id="group_pdm_pcm_more_information"></a>
More Information</h1>
<p>See: the PDM-PCM chapter of the device technical reference manual (TRM); the PDM_PCM_PDL Component datasheet; CE219431 - PSOC 6 MCU PDM-TO-PCM EXAMPLE.</p>
<h1><a class="anchor" id="group_pdm_pcm_changelog"></a>
Changelog</h1>
<table class="doxtable">
<tr>
<th>Version</th><th>Changes</th><th>Reason for Change </th></tr>
<tr>
<td>2.30.1 </td><td>Added Note that this driver supports CAT1A devices only.  </td><td>To avoid misunderstanding of pdm_pcm and pdm_pcm_v2 drivers usage.   </td></tr>
<tr>
<td>2.30 </td><td>Fixed MISRA 2012 violations. </td><td>MISRA 2012 compliance.  </td></tr>
<tr>
<td>2.20.2 </td><td>Minor documentation updates. </td><td>Documentation enhancement.  </td></tr>
<tr>
<td>2.20.1 </td><td>Snippet updated. </td><td>Old snippet outdated.  </td></tr>
<tr>
<td rowspan="2">2.20 </td><td>Flattened the organization of the driver source code into the single source directory and the single include directory.  </td><td>Driver library directory-structure simplification.  </td></tr>
<tr>
<td>Added register access layer. Use register access macros instead of direct register access using dereferenced pointers. </td><td>Makes register access device-independent, so that the PDL does not need to be recompiled for each supported part number.  </td></tr>
<tr>
<td>2.10 </td><td>The gain values in range +4.5...+10.5dB (5 items) of /ref cy_en_pdm_pcm_gain_t are corrected. Added Low Power Callback section. </td><td>Incorrect setting of gain values in limited range. Documentation update and clarification.  </td></tr>
<tr>
<td>2.0 </td><td><p class="starttd">Enumeration types for gain and soft mute cycles are added.<br />
 Function parameter checks are added.<br />
 The next functions are removed:</p><ul>
<li>Cy_PDM_PCM_EnterLowPowerCallback</li>
<li>Cy_PDM_PCM_ExitLowPowerCallback</li>
<li>Cy_PDM_PCM_EnableDataStream</li>
<li>Cy_PDM_PCM_DisableDataStream</li>
<li>Cy_PDM_PCM_SetFifoLevel</li>
<li>Cy_PDM_PCM_GetFifoLevel</li>
<li>Cy_PDM_PCM_EnableDmaRequest</li>
<li>Cy_PDM_PCM_DisableDmaRequest</li>
</ul>
<p>The next functions behaviour are modified:</p><ul>
<li>Cy_PDM_PCM_Enable</li>
<li>Cy_PDM_PCM_Disable</li>
<li>Cy_PDM_PCM_SetInterruptMask</li>
<li>Cy_PDM_PCM_GetInterruptMask</li>
<li>Cy_PDM_PCM_GetInterruptStatusMasked</li>
<li>Cy_PDM_PCM_GetInterruptStatus</li>
<li>Cy_PDM_PCM_ClearInterrupt</li>
<li>Cy_PDM_PCM_SetInterrupt</li>
</ul>
<p class="endtd">The Cy_PDM_PCM_GetFifoNumWords function is renamed to Cy_PDM_PCM_GetNumInFifo.<br />
 The Cy_PDM_PCM_GetCurrentState function is added.  </p>
</td><td>Improvements based on usability feedbacks.<br />
 API is reworked for consistency within the PDL.   </td></tr>
<tr>
<td>1.0 </td><td>Initial version </td><td></td></tr>
</table>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__pdm__pcm__macros"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__pdm__pcm__macros.html">Macros</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__pdm__pcm__functions"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__pdm__pcm__functions.html">Functions</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__pdm__pcm__data__structures"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__pdm__pcm__data__structures.html">Data Structures</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__group__pdm__pcm__enums"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__pdm__pcm__enums.html">Enumerated Types</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
